home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / adaed-1.11 / adaed-1 / Adaed-1.11.0a / symbol.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-07  |  3.0 KB  |  97 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _symbol_h
  10. #define _symbol_h
  11. #include "set.h"
  12.  
  13. typedef struct Symbol_s *Symbol;
  14.  
  15. typedef struct Symbol_s
  16. {
  17.     short        nature;        /* one of na_ codes */
  18.     short        s_seq;    /* sequence number within unit */
  19.     short        s_unit; /* unit number */
  20.     short        type_attr;    /* miscellaneous type attributes */
  21.     short        needname;    /* set if SETL needs full name*/
  22.     Symbol        type_of;    /* type */    
  23.     Symbol        scope_of;    /* scope: symbol table pointer */
  24.     Tuple        signature;    /* pointer to tuple, varies by NATURE */
  25.     Set        overloads;
  26.     Declaredmap    declared;
  27.     Symbol        alias;
  28.     char        *orig_name;
  29.     char        *misc;
  30.     /* remaining fields used only by generator */
  31.     /* we use short intending 16 bits */
  32.     short        type_kind;
  33.     short        type_size;
  34.     Symbol        init_proc;
  35.     Tuple        associated_symbols;  /* for _type, etc */
  36.     short        s_segment; /* REFERENCE_MAP segment */
  37.     short        s_offset; /* REFERENCE_MAP offset */
  38.     Tuple       rcinfo;
  39.     Tuple       repr;
  40.     short       forced;
  41.  
  42. } Symbol_s;
  43.  
  44. /* s_offset was originally unsigned. However, processing of variant
  45.  * records currently requires that it be signed. Also, since currently
  46.  * using words as basic storage unit,there is no great loss in making it
  47.  * signed.    ds    11-18-85
  48.  */
  49. /*
  50. The nature field gives the kind of the entry, i.e., it serves as a
  51. discriminant. The type_of field is a pointer to a symbol entry giving
  52. the type. 
  53. In the SETL source, the field names correspond to maps and are
  54. often referenced in form
  55.     NATURE(x)   TYPE_OF(x)     etc
  56. We require that such usage use upper case and define macros to
  57. avoid the need to translate all such instances. Note however that
  58. instances of lower-case names for fields will have to be translated
  59.     nature(x) -> NATURE(x)
  60. */
  61.  
  62. #define NATURE(x)    ((x)->nature)
  63. /*
  64. NEEDNAME is a local bit used to mark
  65. those symbols which must be presented to the SETL code generator using
  66. their original name as a string, and not using the internal name. This
  67. is required for symbols used as domain values in UNIT_DECL, etc.
  68. */
  69. #define NEEDNAME(x)    ((x)->needname)
  70. #define TYPE_OF(x)    ((x)->type_of)
  71. #define ALIAS(x)    ((x)->alias)
  72. #define SIGNATURE(x)    ((x)->signature)
  73. #define SCOPE_OF(x)    ((x)->scope_of)
  74. #define OVERLOADS(x)    ((x)->overloads)
  75. #define DECLARED(x)    ((x)->declared)
  76. #define ORIG_NAME(x)    ((x)->orig_name)
  77. #define S_SEQ(x)    ((x)->s_seq)
  78. #define S_UNIT(x)    ((x)->s_unit)
  79. #define TYPE_ATTR(x)    ((x)->type_attr)
  80. #define MISC(x)        ((x)->misc)
  81. #define TYPE_KIND(x)    ((x)->type_kind)
  82. #define TYPE_SIZE(x)    ((x)->type_size)
  83. #define INIT_PROC(x)    ((x)->init_proc)
  84. #define ASSOCIATED_SYMBOLS(x) ((x)->associated_symbols)
  85. #define S_SEGMENT(x) ((x)->s_segment)
  86. #define S_OFFSET(x) ((x)->s_offset)
  87. #define RCINFO(x) ((x)->rcinfo)
  88. #define FORCED(x) ((x)->forced)
  89. #define REPR(x) ((x)->repr)
  90.  
  91. #ifdef AMIABLE
  92. #define S_A_CLASS(x)    ((x)->needname)
  93. #define S_A_SEQ(x)    ((x)->s_offset)
  94. #define S_A_PROC(x)    ((x)->s_segment)
  95. #endif
  96. #endif
  97.